package com.bw.finance.controller;


import com.bw.finance.conf.ResponseResult;
import com.bw.finance.service.IEbankRepayPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zxx
 * @since 2020-08-27
 */
@RestController
@RequestMapping("/repay")
public class EbankRepayPlanController {

    @Autowired
    private IEbankRepayPlanService ebankRepayPlanService;

    //还款记录查询
    @PostMapping("getRepayPlan/{id}")
    public ResponseResult getRepayPlan(@PathVariable Long id){
        ResponseResult result = ResponseResult.SUCCESS();
        try {
            result = ebankRepayPlanService.getRepayPlan(id);
        }catch (Exception e){
            result.setSuccess(false);
            result.setMessage("查询失败");
        }
        return result;
    }

    @PostMapping("/getRepayPlanById/{id}")
    public ResponseResult getRepayPlanById(@PathVariable("id") Long id){
        ResponseResult result = ResponseResult.SUCCESS();
        result = ebankRepayPlanService.getRepayPlanById(id);
        return  result;
    }



}
